//
//  BYSearchController.m
//  BYControls
//
//  Created by 彬boy on 2018/11/19.
//  Copyright © 2018年 彬boy. All rights reserved.
//

#import "BYSearchController.h"

@interface BYSearchController ()

@end

@implementation BYSearchController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.dimsBackgroundDuringPresentation = NO;
}

- (instancetype)initWithSearchResultsController:(UIViewController *)searchResultsController searchBarFrame:(CGRect)searchBarFrame placeholder:(NSString *)placeholder textFieldLeftView:(UIImageView *)leftView showCancelButton:(BOOL)showCancelButton barTintColor:(UIColor *)barTintColor{
    if (self = [super initWithSearchResultsController:searchResultsController]) {
        self.ohSearchBar = [[BYNavSearchBar alloc] initWithFrame:searchBarFrame placeholder:placeholder textFieldLeftView:leftView showCancleBtn:YES tintColor:barTintColor];
        UIButton *button = [self.ohSearchBar valueForKey:@"cancelButton"];
        button.tintColor = [UIColor whiteColor];
        [button setTitle:@"取消" forState:UIControlStateNormal];
        [self.ohSearchBar setValue:button forKey:@"cancelButton"];
    }
    return self;
}

@end
